Recently an image encoder and an image decoder have been used, and these image encoder and image decoder supports a video codec in which motion compensation is used, for example the video codec is MPEG2 (Moving Picture Experts Group phase-2) or H.264.
Conventional image encoder and image decoder perform an operation of motion compensation using reference image data to generate prediction image data. The image encoder encodes original image data using the prediction image data. On the other hand, the image decoder decodes the coded data using the prediction image data. For the purpose of the operation of motion compensation, the image encoder and the image decoder store the reference image data stored in a main memory such as a dynamic random access memory (DRAM) in a cache memory, and generate the prediction image data using the reference image data stored in the cache memory.
A general cache memory includes a management area in which management information is stored and a storage area in which cache data is stored. In the cache memory, the cache data is managed in units of cache line size using the management information. The management information includes a flag indicating whether data is valid and a tag corresponding to a bit string which indicates a part of the address of cache data on the main memory.
However, because the cache data is managed in units of cache line size, data smaller than the cache line size cannot be read. Accordingly, even if a part one cache line size of data is used in the operation of motion compensation, only the part cannot be read. As a result, an occupied bandwidth of the main memory increases in reading the data.
On the other hand, an amount of management information increases when the cache line size decreases in order to reduce the occupied bandwidth. As a result, the ratio of a management area to a storage area of the cache memory increases, that is, the use efficiency of the cache memory decreases.